import yagmail,logging

class email_log():
    def send_log(self):
        log_cat = logging.basicConfig(level=logging.INFO,
                                      format='%(message)s %(filename)s %(asctime)s %(levelname)s %(lineno)s',
                                      filename='./rk10.log',
                                      filemode='w+') # w+ 覆盖 a+ 累加
        return log_cat

    def send_email(self,file):
        email = yagmail.SMTP(user='1847537889@qq.com',password='oivvpqyoqybddcgc',host='smtp.qq.com')
        email.send(to='1847537889@qq.com',subject='日考10练习',contents='练习',attachments=file)